package com.smxpt.Dao.Impl;

import com.smxpt.Dao.UserDao;
import com.smxpt.Entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Repository;

@Repository("userDao")
public class UserDaoImpl implements UserDao {
    @Override
    public void save() {
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        User user = (User) ac.getBean("user");
        System.out.println(user);
        System.out.println("模拟执行了UserDaoImpl对象的save方法");
    }
}
